package step3;
import java.util.Scanner;
public class HelloWorld {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        String fileName = input.next();
        String email = input.next();
        judge(fileName,email);
    }
    public static void judge(String fileName,String email){
        //请在此添加实现代码
/********** Begin **********/
        String javajudge = ".java";
        String emailJudge1 = "@";
        String emailJudge2 = ".";
        int javaIndex1 = fileName.indexOf(javajudge);
        int javaIndex2 = fileName.lastIndexOf(javajudge);
        int emailIndex1 = email.indexOf(emailJudge1);
        int emailIndex2 = email.lastIndexOf(emailJudge1);
        int emailIndex3 = email.indexOf(emailJudge2);
        int emailIndex4 = email.lastIndexOf(emailJudge2);
        if(javaIndex1>0&&javaIndex2+javajudge.length()==fileName.length()){
            System.out.println("Java文件名正确");
        }
        else{
            System.out.println("Java文件名无效");
        }
        if(emailIndex1==emailIndex2&&emailIndex3==emailIndex4&&emailIndex1<emailIndex3&&emailIndex1!=-1){
            System.out.println("邮箱名正确");
        }
        else{
            System.out.println("邮箱名无效");
        }

/********** End **********/
    }


}